package com.chaopei.goods_mng_api.entity;


import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
//java扩展包,做校验
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * @Author Corday 天涯
 * @Date 2022/5/5 11:44
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Product {//10个属性
    //要做校验
    @NotNull(message = "不能为空")
    private  int id;
    @Min(value =4,message = "最少4位")
    @Max(value = 20,message = "最大20位")
    private String name;
    @Min(value = 5,message = "最少5位")
    private String code;
    @NotNull(message = "不能为空")
    private String type;
    @NotNull(message = "不能为空")
    private String brand;
    @NotNull(message = "不能为空")
    private String pic;
    @NotNull(message = "不能为空")
    private int num;
    @NotNull(message = "不能为空")
    private double price;
    @NotNull(message = "不能为空")
    private double sale;
    @NotNull(message = "不能为空")
    private  String intro;
    @NotNull(message = "不能为空")
    private int status;

}
